RAID (Redundant Array of Inexpensive Disks) is a technology which improves the reliability of disk storage by storing redundant data to cope with single or multiple disk failures. One type of RAID, known as RAID-1 or “mirroring”, involves using a pair of disks and writing the same data to each disk. In the event of a failure of one of the disks, data can be recovered from the other disk. The RAID-1 approach is relatively inefficient in terms of capacity because only half of the total disk capacity is available for use.
RAID-4 uses a set of N disks, one of which is used solely to store “parity” information. Parity information includes, for example, redundancy information. Parity information or data may refer not only to actual bit-parity blocks, such as (P) blocks, but also to other redundancy information such as error correction syndromes (Q) blocks. In a RAID-4 system with five disks, the fifth disk will be used for parity and its first block will contain the exclusive-or of the contents of the other four disks. In this way, the contents of any one failed disk can be reconstructed from the non-failed disks, but the cost in terms of overall capacity is much smaller as compared to RAID-1 systems.
RAID-5 is similar to RAID-4 but instead of a single disk being dedicated to parity, the data and parity stripes are distributed across all the disks to improve read performance. A set of data and parity/syndrome blocks across some or all of the disks is known as a “stripe”, as will be addressed in greater detail below. RAID-6 is another variant which can allow for two disk failures by storing both P and Q blocks.
With RAID 4, 5, and 6 formats, when one data block of a stripe is modified the parity blocks must be updated accordingly. The RAID implementation must read the unchanged data blocks, recalculate the contents of the P and Q blocks, and then write the changed data block and the P and Q blocks to their respective disks. These actions occur at the direction of the RAID hardware or software.
The file system for a computer system that includes the RAID memory devices is unaware of the details of how the RAID hardware and/or software handles storage matters. “File system” as used herein concerns the overall mechanisms and structures with which files or information are named, stored, and organized. A file system may consist of files, directories, databases, and the code needed to locate and/or access these items. For example, file system can refer to a portion of code, such as an operating system, that translates requests for file operations from an application program into low-level, sector-oriented tasks that can be understood by the drivers controlling the disk drives.
A problem may occur when new data is written and, afterwards, an update to the parity information is saved. A problem may also occur when parity information is saved and, afterwards, an update to the new data is written. In either sequence of events there is a point in time at which a system crash and disk failure could cause incorrect data to be recovered from the parity information. Taking the first sequence of events for example, when updating a data block on a disk there is a short period of time after writing the new data, but before writing the new parity information, during which the RAID array is in an inconsistent state. A crash while this inconsistent state is present, if followed by a disk failure, may lead to data loss or corruption. This problem, known as the “write hole”, is one of the shortcomings of RAID formats.